package com.zerdoor.service.impl;

import com.zerdoor.dao.ArtArticleDao;
import com.zerdoor.service.ArtArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by xiaoji on 2015/1/31.
 * 文章管理接口
 */
@Service
public class ArtArticleServiceImpl implements ArtArticleService {
    @Autowired
    private ArtArticleDao artArticleDao;

    /**
     * 查询文章列表
     *
     * @param map 文章类型
     * @return
     */
    @Override
    public List<Map<String, Object>> getArtArticle(Map<String, Object> map) {
        return artArticleDao.getArtArticle(map);
    }

    /**
     * 添加文章
     *
     * @param map 文章信息
     * @throws Exception
     */
    @Override
    public void addArtArticle(Map<String, Object> map) throws Exception {
        artArticleDao.addArtArticle(map);
    }

    /**
     * 编辑文章
     *
     * @param map 文章信息
     * @throws Exception
     */
    @Override
    public void updateArtArticle(Map<String, Object> map) throws Exception {
        artArticleDao.updateArtArticle(map);
    }

    /**
     * 停用文章
     *
     * @param map 文章信息
     * @throws Exception
     */
    @Override
    public void updateStopArtArticle(Map<String, Object> map) throws Exception {
        artArticleDao.updateStopArtArticle(map);
    }

    /**
     * 激活文章
     *
     * @param map 文章信息
     * @throws Exception
     */
    @Override
    public void updateActivationArtArticle(Map<String, Object> map) throws Exception {
        artArticleDao.updateActivationArtArticle(map);
    }

    /**
     * 删除文章
     *
     * @param id 文章信息
     * @throws Exception
     */
    @Override
    public void deleteArtArticle(int id) throws Exception {
        artArticleDao.deleteArtArticle(id);
    }

    /**
     * 文章类型列表
     *
     * @return
     */
    @Override
    public List<Map<String, Object>> getArtArticleType() {
        return artArticleDao.getArtArticleType();
    }
}
